It is known that the adverse effects of shock wave boundary layer interactions in high speed inlets include reduced total pressure recovery and highly distorted flow at the aerodynamic interface plane (AIP). This paper presents a design method for flow control which creates perturbations in geometry. These perturbations are tailored to change the flow structures in order to minimize shock wave boundary layer interactions (SWBLI) inside supersonic inlets. Optimizing the shape of two dimensional micro-size bumps is shown to be a very effective flow control method for two-dimensional SWBLI. In investigating the three dimensional SWBLI, a square duct is employed as a baseline. To investigate the mechanism whereby the geometric elements of the baseline, i.e. the bottom wall, the sidewall and the corner, exert influence on the flow's aerodynamic characteristics, each element is studied and optimized separately. It is found that arrays of micro-size bumps on the bottom wall of the duct have little effect in improving total pressure recovery though they are useful in suppressing the incipient separation in three-dimensional problems. Shaping sidewall geometry is effective in re-distributing flow on the side wall and results in a less distorted flow at the exit. Subsequently, a near 50% reduction in distortion is achieved. A simple change in corner geometry resulted in a 2.4% improvement in total pressure recovery.